class Player < ActiveRecord::Base
  validates_presence_of :name

  has_many :heros, :dependent => :destroy
  has_many :palaces, :dependent => :destroy
  has_many :deliveries, :foreign_key => 'empfaenger_id', :dependent => :destroy
  has_many :deliveries, :foreign_key => 'lieferant_id', :dependent => :destroy

  def to_s
    name
  end

end
